home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Rhapsody 4 #2
/
Rhapsody 4 - Issue 2.iso
/
!InstallR4
/
DATA
/
099
< prev
next >
Wrap
Text File
|
2000-02-26
|
44KB
|
1,321 lines
Rhapsody4 Data Structure
~~~~~~~~~~~~~~~~~~~~~~~~
Rhapsody 4 files differ from earlier versions in the following
major ways.
* They are fully word aligned
* They use lettered identifiers to make slots and data more easily
recognizable
* Block lengths are now allocated two bytes. Data lengths are now
allocated one whole byte. This means that there are effectively no
restrictions on the number of notes in a slot or the length of data
items
* A large number of restrictions have been removed
Overall structure
~~~~~~~~~~~~~~~~~
&50414852 RHAP
&59444F53 SODY
&30302E34 4.00
&0000000D <CR>
&xxxxxxxx Block type
&ffffllll Block flags and length
&2A2A2A2A ****
Block types
~~~~~~~~~~~
**SC 43532A2A contains data about the whole score
**ST 54532A2A contains data about a particular stave
**SY 59532A2A contains data about a system (ie a line)
**HD 44482A2A contains data about the titles
**SL 4C532A2A contains data about a data slot
**EX 58452A2A contains exclusive data
Every Rhapsody file must start with a **SC block followed by the
correct number of **ST blocks. Next comes at least one **SY block and
the **HD block. These are followed by any number of **SL blocks
interspersed with (optional) **SY blocks.
All current and future versions of Rhapsody ignore **EX blocks.
Every file must end with ****.
The **SC block
~~~~~~~~~~~~~~
0 &43532A2A **SC
4 &ffffllll flags and length see note 1
8 4*10 offset to start of font list
12 nstaves number of staves
16 playopt play options see note 1a
20 speed playing speed see note 1b
24 midibeat MIDI beat channel and pitch see note 1c
28 printopt print options see note 1e
32 score length in bytes
36 score width total width of all slots in OS units
40 midibeatdata MIDI beat pc data see note 1d
44 initial initial bar and page numbers etc. see note 1f
4*(n+1) offset to end of body text font
n copyright font family (CR terminated)
4*(n+1) offset to end of alternative text
n copyright font family (CR terminated)
4*(n+1) offset to end of copyright notice
n copyright copyright notice (CR terminated)
Notes
~~~~~
1. Flags bit 31 set - this score has been created by
Rhapsody4 and does not need resetting
bit 30 set - all data code lengths have been
changed from bytes to words
bit 29 set - this score begins with an
annacrusis bar
1a. Play options (1 word)
bits if set...
0 MIDI flag (play MIDI)
1 speaker flag (play speaker)
2 scroll flag (scroll window while playing)
3 (not used)
4 repeat (play all repeats)
5 speaker beat flag (play beat through speaker)
6 MIDI beat flag (play beat through MIDI)
7 MIDI clock (transmit MIDI clock signals)
8 swing flag (if set, swing rythm)
9-15 (not used)
16-23 randomise 0 to 100
24-31 expression -100 to 100
1b. Speed (1 word)
100 = normal speed
1c. MIDI beat channel and pitch
bits
0-3 MIDI beat channel (default value 9 (ie channel 10))
4-7 unused
8-15 pitch: 60 = middle C (default value 37)
16-27 unused
28-31 MIDI beat port (default vaue 0 (ie port 1))
1d. MIDI beat data (default &40000000)
bits default
0-7 MIDI program number+1 (0-128) 0 = don't send 0
8-15 bank number LSB+1 (0-128) 0 = don't send 0
16-23 bank number MSB+1 (0-128) 0 = don't send 0
24-30 MIDI stereo position (0-127) 64
31 not used (must be zero)
1e. Print options (1 word)
bits
0 0 = 4/4 1 = C (common time)
1 0 = 2/2 1 = C' (alla breve)
2 0 = triplets with gap 1 = triplets without gap
3 0 = bracket all triplets 1 = unbeamed triplets only
4 0 = offset heads 1 = share heads
5 0 = back to back 1 = interlock heads
6 0 = pedal lines 1 = pedal sprites
7 0 = rehearsal letters 1 = rehearsal numbers
8 0 = don't count 1 = count 1st time bars
9 0 = no slash 1 = slash between systems
10 0 = normal time sigs 1 = time sigs above stave
11 0 = normal clefs 1 = old clefs
12 1 = show guitar chord names
13 1 = show tablature
14 1 = pedal sprites with dashed lines
1f. Initial numbers (1 word)
0-7 not used
8-15 initial rehearsal letter
16-23 initial bar number
24-31 initial page number
The **ST block
~~~~~~~~~~~~~~
0 &54532A2A **ST
4 &ffffllll length
8 4*4(+128) offset to end of stave data
12 stavedata1 stave data see note 2a
16 stavedata2 stave data see note 2b
20 stavedata3 stave data see note 2c
(24 optional pitchmap see note 2d)
1 4*(1+m) offset to end of stave name
m stname stave name (var length, CR terminated)
1 4*(1+n) offset to end of stave abbreviation
n stabbrev stave abbreviation (var length, CR terminated)
1 4*(1+o) offset to end of stave voice
o stvoice stave voice (var length, CR terminated)
Notes
~~~~~
2a. stave data (1) (default &08434020)
bits default
0-3 MIDI channel number - 1 (0-15) 0
4-7 number of ARC sound channels allocated (0-8) 2
8-14 transpose interval + 64 64
15 join stave to one above 0
16-18 stereo position (0-6) 3
(0=full left, 3=centre, 6=full right)
19-21 0 = normal stave 0
1 = solo stave (reduced in height)
2 = percussion stave
3 = sol-fa stave (with barlines etc.)
4 = blank stave (no barlines or time sigs)
5 = hidden stave (nothing visible)
22 bracket stave to one above [ 1
23 single bracket 0
24 brace stave to one above { 0
25 if set, pitch map present 0
26-27 loudness (0-3 = Silent, Quiet, Normal, SOLO) 2
28-31 MIDI port number (0-3) 0
Note that, unlike Rhapsody3 which allocates a unique set of
internal voice channels to each stave, Rhapsody 4 lumps all
staves which use the same voice together. It then allocates
as many channels to that voice as possible using the number
of sound channels specified as a minimum.
2b. stave data (2) (default &00000000)
bits default
0-7 MIDI program number+1 (0-128) 0 = don't send 0
8-15 bank number LSB+1 (0-128) 0 = don't send 0
16-23 bank number MSB+1 (0-128) 0 = don't send 0
24-30 MIDI stereo position (0-127) 64
31 not used (must be zero)
2c. stave data (3) (default &00600060)
bits default
0-15 height above centre (in OS units) 96
16-31 height below centre (in OS units) 96
2d. pitch map
This is an array of 128 bytes which map one pitch on to another.
The set is optional depending on bit 25 of stavedata1.
The **SY block
~~~~~~~~~~~~~~
A **SY block contains data about a musical system - ie a line
of music on a page. Every Rhapsody file has at least one **SY block which
prints the score in linear mode. Other sets of **SY blocks are created
and maintained as required. Each set has a format number. The linear
mode **SY block has format number = 0. The **SY block is the block which
actually prints the staves, the clefs and key signatures. **SY blocks
may contain slot data but this is not recommended as this data will be
lost if that particular format is deleted. Only the first **SY block
of a set in the file contains an FD data block. The linear mode **SY
block does not contain an FD data block.
0 &59532A2A **SY
4 &ffffllll flags and length see note 3a
8 &0000ffww incl. width required for clef & keysig
12.. data see data codes below
System Data (7+nstaves+1+nslots words) [SD]
-----------
0 ll004453 SD block header ll = 7+n (+1+nslots if format>0)
4 aaaaaaaa extra OS units required per slot (may be negative)
(extra width is not added to either the system
slot or the last barline slot)
8 bbbbbbbb extra OS units required in the first slot
12 lhindent left hand indent (OS units)
16 vtindent vertical indent (OS units from the very top)
20 selection1 if bit set, print staves 0-31
24 selection2 if bit set, print staves 32-50
28.. bbbbtttt stave top and bottom spaces for each stave
(including those not printed)
28+4*nstaves%
0000nnnn nnnn = number of slots in system inc sys slot
bbnnffww slotwidth info for each slot see note 3b
(The System Data for format 0 does not have any slotwidth info)
Format Data (12+n words) [FD]
-----------
0 ll004446 FD block header ll = 12+n
4 formatopt format options etc see note 3c
8 formatsize format size (points)
12 selection1 if bit set, select staves 0-31
16 selection2 if bit set, select staves 32-50
20 pagebreadth scaled OS units see note 3d
24 pagelength scaled OS units
28 top margin scaled OS units
32 bottom margin scaled OS units
36 left margin scaled OS units
40 right margin scaled OS units
44 4*(1+n) offset to end of format name (o)
48.. CR terminated format name
o data other data blocks see data codes below
(notably, pedal and octavo codes)
Notes
~~~~~
3a. flags
bit
16-24 format number
31 if set this block starts a new page (and will not be
removed by reformatting)
3b. bit
0-7 slot width (in OS units)
8-15 front space (in OS units)
16-24 number of empty slots to be passed over before printing
next slot
25-31 number of bars rest
3c. Format options
Bit
0 0 = portrait 1 = landscape
1 0 = page numbers off 1 = page numbers on
2-3 0 = central page numbers
1 = left page numbers
2 = right page numbers
3 = alternate page numbers
4 0 = top page numbers 1 = bottom page numbers
5 0 = bar numbers off 1 = bar numbers on
6 0 = bar numbers at start 1 = bar numbers every 5 bars
7 0 = headers off 1 = headers on
8 0 = no indent 1 = indent first stave
9 0 = omit 1 = print short stave names
10 0 = fixed 1 = alternate margins
11 not used (must be zero)
12-15 packing factor 0-7 = 0 to +35%
8-15 = -40 to -5%
16-23 initial page number
24-32 not used (must be zero)
3d. Scaled OS units
At 100% scale, 1mm = 7.09 OS units; 100 OS units = 14.1 mm
If the format size is 8 (ie 50%), a page length of 297 mm would
be entered as 297*7.09/0.5 = 4211 scaled OS units
The **HD block
~~~~~~~~~~~~~~
This block contains information about the Titles, headings and
footers. All the data slots are optional.
1 &44482A2A **HD
1 &0000llll length
1 &00000000 (not used)
n data see data codes below
**HD Data Codes
~~~~~~~~~~~~~~~
The first word of each code has the following structure
&ll00cccc
ll is the length (in words)
cc is the code letter pair
Title (5+m+n words) [TL]
-----
1 &llnn4C54 nn is a code from 0-3 as follows
nn = 0 main title
nn = 1 main sub title
nn = 2 left hand sub title
nn = 3 right hand sub title
1 &0000xxxx (as measured from the top left hand corner)
(xxxx=&FFFF means centered)
(xxxx=&FFFE means right justified)
1 x point size
1 y point size
1 4*(1+m) offset to end of font name
m CR terminated font name or style
1 4*(1+n) offset to end of text
n CR terminated text
Header (5+m+n words) [HD]
------
1 &ll004448
1 &xxxxyyyy (not used)
1 x point size
1 y point size
1 4*(1+m) offset to end of font name
m CR terminated font name or style
1 4*(1+n) offset to end of text
n CR terminated text
Footer (5+m+n words) [FT]
-----
1 &ll005446
1 &00000000 (not used)
1 x point size
1 y point size
1 4*(1+m) offset to end of font name
m CR terminated font name or style
1 4*(1+n) offset to end of text
n CR terminated text
Page Number (5+m+n words) [PN]
-----------
1 &ll004E50
1 &00000000 not used
1 x point size
1 y point size
1 4*(1+m) offset to end of font name
m CR terminated font name or style
1 4*(1+n) offset to end of text
n CR terminated text (position of page number indicated with <#>)
Signature (5+m+n words) [SG]
---------
This is positioned at the very end of the score
1 &ll004753
1 &00000000 not used
1 x point size
1 y point size
1 4*(1+m) offset to end of font name
m CR terminated font name or style
1 4*(1+n) offset to end of text
n CR terminated text
The **SL block
~~~~~~~~~~~~~~
0 &4C532A2A **SL
4 &ffffllll flags and length see note 4a
8 slotwidth slot width see note 4b
n data see data codes below
Notes
~~~~~
4a. flags
bits
16-18 0 = no barline
1 = ordinary barline
2 = 1st time bar
3 = 2nd time bar
4 = rehearsal letter
19 blank stave
20-28 not used (must be zero)
29 slot contains info item (CL, KS, TS, GD, OB)
30 slot contains long item (TX, VC, HP, PM, OC, PD, NC(tied))
31 barline
4b. slotwidth/time
1 &ttttffww
Each slot has an imaginary line down it called the note line on
which the notes are placed. The front space is the distance between
the note line and the front of the slot.
ww is the total width (OS units) (max 255)
ff is the front space (OS units) (max 255)
tttt is the time from the start of the bar in microbeats
(1 crotchet = 96 microbeats)
Data codes
~~~~~~~~~~
The first word of each code has the following structure
&llsscccc
ll is the length (in words)
ss is the stave number (0 = all staves))
cc is the code letter pair
Volume (3 words) [VO]
------
0 &0Css4F56
4 target volume (0-127). The 'normal' volume is 100 giving some
room for crescendo.
8 number of beats (0-255). This is the number of (crotchet) beats
over which the crescendo or decrescendo is to take place.
Tempo (3 words) [TP]
-----
0 &03005054
4 target tempo (0-512). All tempos are in crotchets per minute
8 number of beats (0-255). This is the number of (crotchet) beats
over which the tempo change is to take place.
Expression (3 words) [EX]
----------
0 &03004558
4 Depth (-100 - 100)
8 not used (must be zero)
MIDI event (4+n words) [MD]
-----
0 &nn00444D
4 start data.
8 end data.
12 number of microbeats. This is the number of microbeats over
which the data is to be transmitted. (If this word is zero, the
end data should be equal to the start data.)
16 MIDI data (CR terminated)
MIDI data is held as a text string in hex separated by commas.
The symbol 'c' is substituted during transmission by the channel
number. The symbol 'xx' is substitued by a 7 bit data value. The
symbol 'll,hh' is substitued by a 14 bit data value. Graded
changes are sent every microbeat or whenever the value changes.
Clef (2 words) [CL]
----
0 &02ss4C43
4 bits 0-3 clef number
bits 8-11 previous clef number
clef number : position of middle C on stave
0 = no clef printed (default to treble): 26
1 = treble : 26
2 = alto : 32
3 = vocal tenor : 33
4 = instrumental tenor : 34
5 = bass : 38
6 = percussion : 26
7 = soprano clef : 28
8 = mezzo soprano clef : 30
9 = baritone clef : 36
Key Signature (2 words) [KS]
-------------
0 &02ss534B
4 bits 0-7 key number
bits 8-15 previous key number
0 = no key signature (defaults to C major)
1-7 = flats, ...
8 = no flats or sharps (ie C major), ..
9-15 = sharps
Time signature (2 words) [TS]
--------------
0 &02005354
4 &0000bbnn
nn = number of beats in a bar
bb = beat type: 8=quaver, 4=crotchet, 2=minim etc.
Other barlines (2 words) [OB]
--------------
0 &0200424F
4 bit 0-3 1=half barline
2=double bar
3=endbar
4=start repeat
5=end repeat
6=double repeat
7=dashed bar line
8=caesura
Global directives (3 words) [GD]
--------------
0 &03004447
4 &xxxxyyyy
8 bit 4-7 0 = no special sign
1 = no special sign
2 = segno sign
3 = coda wheel
4 = da capo
5 = da capo al fine
6 = dal segno
7 = dal segno al fine
8 = fine
9 = coda
10 = suppress triplet printing from here
11 = reinstate triplet printing
12 = suppress accent printing from here
13 = reinstate accent printing
Definitions (15 words) [TD]
-----------
0 &0D004454
4 &0000llww % length/weight for staccato notes
8 &0000llww % length/weight for spiccato notes
12 &0000llww % length/weight for tenuto notes
16 &0000llww % length/weight for accented notes
20 &0000llww % length/weight for stressed notes
24 &0000llww % length/weight for sforzando notes
28 &00xxnnss (x8)
ss bit 0 if set, upper interval is tone, else semi-tone
1 if set, lower interval is tone, else semi-tone
2-3 0 = trill begins on middle note
1 = trill begins on upper note
2 = trill begins on lower note
4 if set, trill has a turn at the start
5 if set, trill has a turn at the end
6-7 0 = trill has no shakes (ie is a grace note or turn)
1 = trill has one shake
2 = trill has two shakes
3 = trill has continuous shakes
nn number of notes per crotchet (1-31)
nn = 0 means fit as many notes as is reasonable
xx bit 0-1 0 = normal upper note
1 = upper note sharp
2 = upper note flat
bit 2-3 0 = normal lower note
1 = lower note sharp
2 = lower note flat
bit 7 if set, ignore bits 0 and 1 of ss and use xx instead
Text (3+n words) [TX]
----
0 &llss5854
4 xxxxyyyy
8 ffffffff If bit 31 set, text is autospaced
12 text (CR terminated)
Channel voice change (3+n words) [VC]
--------------------
0 &llss4356
4 Not used
8 MIDI program/bank change number
bit 0-7 MIDI program number+1 (0-128) 0 = don't send
bit 8-15 bank number LSB+1 0 = don't send
bit 16-23 bank number MSB+1 0 = don't send
bit 24-32 not used (must be zero)
12 CR terminated string containing Archimedes voice name
Dynamics (3 words) [DN]
--------
0 &03ss4E44
4 &xxxxyyyy see note 5
8 bit 0-3 0=silent, 1=ppp, 2=ppp+, 3=pp
4=pp+, 5=p, 6=p+, 7=mp
8=mp+, 9=mf, 10=mf+, 11=f
12=f+, 13=ff, 14=ff+, 15=fff
bit 7 if set, don't print
Directives (3 words) [DR]
----------
0 &03ss5244
4 &xxxxyyyy see note 5
8 0 = cresc. 1 = decresc. 2 = dim.
4 = accel. 5 = rit. 6 = rall.
8 = pizz. 9 = arco
Pedal (3 words) [PD]
-----
0 &03ss4450
4 &0000yyyy (see note 5)
8 bit 0 : if set, pedal on
bit 1 : if set, pedal off
(Note that the pedal may be set off and on again in the same slot)
Octavo (3 words) [OC]
------
0 &03ss434F
4 &xxxxyyyy (see note 5)
8 bit 0 0=start symbol, 1=end symbol
bit 1 0=print, 1=don't print symbol
bits 24-31 transpose interval (signed)
NB Octavo start codes should be placed before any note codes but
octavo end codes should be placed at the end of the slot
NB Octavo end codes ignore the transpose interval and reset the
transpose interval to the previous value
Bowing marks (3 words) [BM]
------------
0 &03ss4D42
4 &xxxxyyyy see note 5
8 bit 0 0 = up bow 1 = down bow
Pause symbols (3 words) [GP]
-------------
0 &03ss5047
4 &xxxxyyyy (see note 5)
8 bits 0-1 0 = pause
1 = inverted pause
2 = breath
Hairpin start (4 words) [HP]
-------------
0 &04ss5048
4 id number
8 &xxxxyyyy coords of start (see note 5)
12 0 = crescendo
1 = decrescendo
2 = solid line
3 = dotted line
Hairpin end (4 words) [HQ]
-------------
0 &04ss5148
4 id number
8 &xxxxyyyy coords of end (see note 5)
12 &00000000 not used
Phrase mark start (4 words) [PM]
-----------------
0 &04ss4D50
4 &nnnnnnnn id number
8 &xxxxyyyy coords of start (see note 5)
12 &xxxxyyyy coords of first cp rel. to start (see note 5)
Phrase mark end (4 words) [PN]
---------------
0 &04ss4E50
4 &nnnnnnnn id number
8 &xxxxyyyy coords of end (see note 5)
12 &xxxxyyyy coords of second cp rel. to end (see note 5)
Square bracket (3 words) [SB]
--------------
0 &03ss4253
4 &xxxxyyyy coords of centre (see note 5)
bits 0-7 length (os units)
bit 31 if set, right bracket
Guitar chords (6 words) [GC]
-------------
0 &06ss4347
4 &xxxxyyyy (see note 5)
8 bits 0-3 position on Efret (0 = don't play)
bits 4-7 position on Afret (0 = don't play)
bits 8-11 position on Dfret (0 = don't play)
bits 12-15 position on Gfret (0 = don't play)
bits 16-19 position on Bfret (0 = don't play)
bits 20-23 position on Efret (0 = don't play)
12 Name (CR terminated) (max 11 chars)
Repeat bar sign (%) (2 words) [RB]
---------------
0 &03ss4252
4 not used (must be zero)
Rest (3 words) [RS]
----
0 &03ss5352
4 rest length (see note length below)
8 bits 0-5 position on stave (0-63)
bit 23 if set, rest is part of a nplet and does not need
npleting [*]
Note cluster (4+n+g words) [NC]
------------
0 &llss434E
4 note length
bit 0-2 0 = hemi-demi-semi-quaver
1 = demi-semi-quaver
2 = semi-quaver
3 = quaver
4 = crotchet
5 = minim
6 = semi-breve
7 = breve
3-4 0 = no dots
1 = single dot
2 = double dot
3 = triple dot
5 if set, then nplet
6 if set, note is the start of an nplet [*]
7 not used (must be zero)
8-11 aplet (eg for standard triplet aplet=3)
12-15 bplet (eg for standard triplet bplet=2)
16-31 not used (some old scores may have some bits set)
8 note flags
bit 0-4 0 = normal
1 = staccato
2 = spiccato
3 = tenuto
4 = accented
5 = stressed
6 = sforzando
7 = fortepiano
8 = silent
11 = glissando
12 = quaver tremolo
13 = semi-quaver tremolo
14 = demi-semi-quaver tremolo
15 = twin tremolo
16 = trill 1
17 = trill 2
18 = upper mordent
19 = baroque upper mordent
20 = lower mordent
21 = baroque lower mordent
22 = turn
23 = inverted turn
5 if set, harmonic
6,7 0 = normal
1 = force beam
2 = break beam
3 = half beam (not implemented)
8-11 0 = not spread
1-15 spread speed
12 if set, play top to bottom
13 if set, play on the beat
14 if set, print arrow
15 if set, note is small (cue part)
16 if set, note has a downstalk
17 if set, note is tied
18 if set, note is slurred
19 if set, note has no stem
20 if set, note is tied to a previous note and does
not need playing [*]
21 if set, note is part of a beam and does not need
beaming [*]
22 if set, note is slurred to a previous note and does
not need slurring [*]
23 if set, note is part of a nplet and does not need
npleting [*]
24-31 actual stalk length (OS units div 4) taking into
account beams (not changed for reduced staves) [*]
12 note flags2
bit 0-3 number of notes (n)
bit 4-7 number of grace notes (g)
bit 8 0 = acciaccatura, 1 = appoggiatura
9 0 = chord, 1 = separated
10 0 = played before the beat, 1 = played on the beat
11 0 = unslurred, 1 = slurred
12 if set beam to note on stave above
13 if set beam to note on stave below
14-16 micro adjust accents (OS units DIV 4)
17-18 not used (must be zero)
19 if set, alternative cluster
20 if set, slur is printed the 'wrong' way up
21 if set, cluster contains some reversed notes [*]
22-25 positive cluster offset (OS units DIV 4)
26-29 negative offset of grace cluster (OS units DIV 4)
16 lowest note attributes ... highest note attributes
bit 0-5 position on stave (0-63)
6 if set, tie is printed the 'wrong' way up
7 if set, note is printed on 'wrong' side [*]
8-10 0 = no accidental
1 = sharp
2 = flat
3 = natural
4 = double sharp
5 = double flat
6 = natural sharp
7 = natural flat
11 bracketed accidental
12-15 negative offset of accidental (OS units DIV 4)
16,17 not used (must be zero)
18-20 0 = normal
1 = small
2 = cross
3 = diamond
4 = open diamond
5 = headless
21-31 not used (must be zero)
16+4*n 0-5 position on stave (0-63: 32 = centre line on stave)
6,7 not used (must be zero)
8-10 0 = no accidental
1 = sharp
2 = flat
3 = natural
4 = double sharp
5 = double flat
6 = natural sharp
7 = natural flat
16+4*n+4*g
Notes
~~~~~
[*] Flags marked with a * are set by Rhapsody automatically and can
be ignored (or set to zero) by other programs
5. Graphics coordinates
Many data items have associated coordinates. These are specified
in a single word as two signed 16 bit integers
&xxxxyyyy
xxxx x coord offset
yyyy y coord offset
offsets are measured in OS units from the point where the note
line intersects the stave line with the exception of the left square
bracket where the offset is measured from the front of the slot
Notes on creating a simple R4 score
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first 4 words should be
&50414852 RHAP
&59444F53 SODY
&30302E34 4.00
&0000000D <CR>
The **SC block should look like this
&43532A2A **SC
&40000054 bit 30 must be set, bit 31 must be unset so that R4 will
recalculate all slot widths and flags on loading
&00000028 offset to font list
&000000nn nn = number of staves
&00000077 play options
&00000064 playing speed
&00002509 midibeat options
&00000030 print options
&0000llll llll - score length in bytes
&00000000 can be ignored if bit 31 unset above
&40800101 midibeat pc data
&01010100 initial bar and page numbers
&0000000C offset
&6E697254 body font 1 (Trinity)
&0D797469
&00000010 offset
&656D6F48 body font 2 (Homerton)
&6E6F7472
&0000000D
&00000008 offset
&0D3EA93C Copyright notice (<⌐>)
The there should be a number of stave slots eg:
&54532A2A **ST
&0000003C length of slot
&00000010 offset
&08434020 stavedata1
&40000000 stavedata2
&00600060 stavedata3
&00000008 offset
&0000000D stave name (blank)
&00000008 offset
&0000000D stave abbreviation (blank)
&00000014 offset
&69727453 stave voice
&694C676E
&6F532D62
&000D7466
There follows a system slot:
&59532A2A **SY
&0000002C length (&28 + 4*number of staves)
&00000010 slot width
&08004453 SD code (length 8)
&00000000 extra OS units
&00000000 extra OS units
&00000190 left hand indent
&FFFFFFB0 vertical indent (negative)
&FFFFFFFF stave selection (all)
&FFFFFFFF stave selection
&00600060 stave heights (repeated as necessary)
... "
and a blank header slot:
&44482A2A **HD
&0000000C length
&00000000 (not used)
Now the data slots of which this is an example:
&4C532A2A **SL
&00000014 flags = 0, length &14
&00000000 slotwidth (will be calculated by R4 on loading if
bit 31 above is unset)
&02014C43 clef code CL, stave 1, length 2 words
&00000001 treble clef
The end of the file is terminated with
&2A2A2A2A ****
Other points
~~~~~~~~~~~~
If bit 31 of the score flags is unset, R4 will inspect every slot in
the score on loading and reset certain flags etc. These include
the score flags (bits 29-31)
bits 29 and 30 of the slot flags
all slot width and timing information
the 'previous clef' number
the 'previous key signature' number
Appendix
~~~~~~~~
Preferences are held in a small data file containing the following
BASIC style data items
INT display options bit 0 beams
bit 1 bar numbers
bit 2 spots
bit 3 timings
bit 4 extended cursor
INT colours1 bit 0-3 cursor body
bit 4-7 cursor edge
bit 8-11 step capture
bit 12-15 control spots
bit 16-19 size handles
INT colours2 bit 0-3 speed changes
bit 4-7 volume changes
bit 8-11 timings
bit 12-15 bar numbers
bit 16-19 hidden dynamics
INT autosave bit 0-7 auto save time (0-255 minutes)
bit 8 autosave on
bit 9 prompt before saving
bit 10 perform autochecking
bit 11 too many
bit 12 too few
bit 13 alignment
INT autonotes bit 0-7 note used for capturing rests
bit 31 use note to capture rests
INT miscopt bit 0 sound notes while dragging
bit 1 sound notes on insertion
bit 2 automatic alignment on insertion
bit 3 show tip of the day
INT dynamicsmap bit 0-3 1 level (ppp)
bit 4-7 3 level (pp)
bit 8-11 5 level (p)
bit 12-15 7 level (mp)
bit 16-19 9 level (mf)
bit 20-23 11 level (f)
bit 24-27 13 level (ff)
bit 28-31 15 level (fff)
INT level 1 = basic
2 = intermediate
3 = advanced
INT printopt
INT initial numbers
INT recordopt
INT playopt
INT playspeed
INT midibeat
INT midibeatdata
INT stavedata1
INT stavedata2
INT stavedata3
STRING stavename$
STRING staveabbrev
STRING stavevoice
INT pagetype
INT format options
INT format size
INT top margin (OS units)
INT bottom margin (OS units)
INT left margin (OS units)
INT right margin (OS units)
INT save box shortcut (0=F3, 1=^ïF3, 2=F11)
R4Player messages
~~~~~~~~~~~~~~~~~
R4Player is a Wimp application which has no windows or menus.
Its function is to play Rhapsody4 files or MIDIfiles and to generate
MIDI files on request from another application. It responds to the
following messages with the associated parameter blocks described.
Normally, applications will issue an 'Are you here' message.
If this message is returned empty, they should start up R4Player from
their own resources. R4Player keeps track of which applications have
requested its services and when all such applications have died, it
will kill itself.
PLAY% &506C0 (plays a Rhapsody4 or MIDI file)
20 pointer to start of score
24 pointer to play position
28 dynamics map
32 recording flag (TRUE during real-time capture)
Note, in the case of Rhapsody4 files, the play position
pointer does not have to point to a slot, R4Player scans ahead to find
a slot to play. In the case of MIDI files, only the start pointer is
relevant.
MIDI% &506C1 (generates a MIDI file)
20 pointer to start of score
24 pointer to start of output block
28 dynamics map
32 MIDI format (0 or 1)
PAUS% &506C2 (Pauses playing temporarily)
SPED% &506C3 (Changes the tempo)
20 Speed (100 = normal speed)
HALT% &506C4 (stops play immediately)
No data required
R4PL% &506C5 (are you here?)
This message is broadcast by any application interested in
using R4Player. If present R4Player notes the task handle of the
application and responds with a HELO message.
PMSF% &506C6 (generates a PMS file)
20 pointer to start of score
24 pointer to start of output block
SDAT% &506C7 (sends stave data)
20 stave data for all staves (1 word each)
R4Player issues the following messages:
MESS% &506D0
20 message text
POSN% &506D1 (Sends position)
20 x coordinate (R4 files only)
24 % of file played
This is used by Rhapsody4 to scroll the window during play.
STPD% &506D2 (Play stopped)
No data required
This is issued if, for any reason, R4Player has to stop
playing.
DONE% &506D3 (MIDI file created)
20 start of MIDI file (inclusive)
24 end of MIDI file (exclusive)
This is issued when a R4Player has finished creating a MIDI file.
HELO% &506D4
No data required
This message is issued in response to an 'are you here?'
message. It is also issued when R4Player is started up to let
applications know that it has arrived.
PMSD% &506D5 (PMS file created)
20 start of PMS file (inclusive)
24 end of PMS file (exclusive)
This is issued when a R4Player has finished creating a MIDI file.
Other messages:
&506E0 (Midi string)
20 midi string
R4render
~~~~~~~~
R4render is a relocatable module which will render a
Rhapsody4 score or produce a drawfile. It respondes to a single star
command which has a single parameter:
*R4render <parameter block>
The parameter is a pointer to a 24 word parameter block
defined as follows
block%!0 pointer to base of score
block%!4 view scale (%)
block%!8 format number
block%!12 page number (first page is zero)
block%!16 x origin
block%!20 y origin
block%!24 pointer to cursor
block%!28 cursor stave
block%!32 cursor position (-31 to 31)
block%!36 min x coord of graphics window
block%!40 min y coord of graphics window
block%!44 max x coord of graphics window
block%!48 max y coord of graphics window
block%!52 0 = printing to screen
1 = printing hardcopy
2 = create drawfile
block%!56 1,2 = normal cursor
3 = drop mode style
4 = step capture style (both tails)
5 = step capture style (up tails)
6 = step capture style (down tails)
block%!60 block start pointer
block%!64 block end pointer
block%!68 block first stave
block%!72 block last stave
block%!76 preferences
block%!80 colours 1
block%!84 colours 2
block%!88 pointer to start of drawfile
block%!92 max size of drawfile
(c) J.O.Linton
09 May 1998